#include <QApplication>
#include "dialog.h"
#include "dialogdata.h"

//"QLineEdit {border: 2px solid gray; border-radius: 10px; padding: 0 8px; }"
//Qt::transparent                    "QCommandLinkButton{border-image: url(none);min-width:60px;min-height:16px;} QPushButton:hover{border-image: url(:/pic/btn_down) 5;}QPushButton:pressed{border-image: url(none);}"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QString qscurr ="QPushButton{border-image: url(:/pic/btn_normal) 5;border-width:5px; min-width:60px;min-height:16px;} QPushButton:hover{border-image: url(:/pic/btn_hover) 5;}QPushButton:pressed{border-image: url(:/pic/btn_down) 5;}"
                    "QCommandLinkButton{border-image: url(:/pic/cmdlink_btn_bg) 5;min-width:60px;min-height:16px;} QCommandLinkButton:hover{border-image: url(:/pic/btn_down) 5;} QCommandLinkButton:pressed{border-image: url(:/pic/cmdlink_btn_bg) 5;}"
                    "QWidget{font: 9pt 'Arabic Transparent';}"
                    "QTextBrowser{background-color:transparent; text-align:center;alignment: center;}"
                    "QDialog{border-image: url(:/pic/dlg_bg) 50 5 5 110;border-width:50px 5px 5px 110px;} "
                    "QTableView{background-color:transparent; text-align:center;alignment: center;} "
                    "QInputDialog,QMessageBox{border-image: url(:/pic/message_bg) 5;border-width:5px;} "
                    "QTabWidget::tab-bar {left:110px; alignment: right;}"
                    "QTabWidget::pane {color: rgb(246, 246, 244); margin: 0px,1px,1px,1px; border: 0px solid #020202; border-radius: 7px;}"
                    "QTabBar::tab {margin-left:0px;color: black;border-image: url(:/pic/tab_btn_bg) 5 5 13 5; border-width:5px 5px 13px 5px;min-width:80px;min-height:20px;}"
                    "QTabBar::tab:hover {color: black; border-image:url(:/pic/tab_btn_normal); }"
                    "QTabBar::tab:selected{color: white; border-image:url(:/pic/tab_btn_hover); }"
                    "QLineEdit{color: black; border-image:url(:/pic/edt_bg) 2px;border-width:2px;}"
                    "QProgressBar { border: 1px solid grey;  border-radius: 2px;text-align: center;}"
                    "QProgressBar::chunk { background-color: #05B8CC; width: 16px;}";

    a.setStyleSheet(qscurr);

    QDialog *pdlg = NULL;
    QStringList arglist = a.arguments();
    if (arglist.contains("data"))
    //if (true)
    {
        qDebug("Gatyping DataeditDlg");
        pdlg = new DialogData();
     }
    else
    {
        qDebug("Gatyping MainDlg");
        pdlg = new Dialog();
    }

    Qt::WindowFlags flags = pdlg->windowFlags();
    flags |= Qt::WindowMinimizeButtonHint;
//    flags |= Qt::WindowMaximizeButtonHint;
    pdlg->setWindowFlags(flags);
    pdlg->show();

    int ret = a.exec();
    delete pdlg;

    return ret;
}
